Variant of gtk_window_present which takes a timestamp. (#166379, Elijah
authorMatthias Clasen <mclasen@redhat.com>
Mon, 20 Jun 2005 18:19:34 +0000 (18:19 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 20 Jun 2005 18:19:34 +0000 (18:19 +0000)
2005-06-20  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtk.symbols:
* gtk/gtkwindow.h:
* gtk/gtkwindow.c (gtk_window_present_with_time): Variant of
gtk_window_present which takes a timestamp.  (#166379, Elijah Newren)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
docs/reference/ChangeLog
docs/reference/gtk/gtk-sections.txt
gtk/gtk.symbols
gtk/gtkwindow.c
gtk/gtkwindow.h

index d521ecbb876c996561c38d631d3fea75c899e00b..ef30e5e7b422453e8779cd64416d70c252b175a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk.symbols:
+       * gtk/gtkwindow.h:
+       * gtk/gtkwindow.c (gtk_window_present_with_time): Variant of
+       gtk_window_present which takes a timestamp.  (#166379, Elijah Newren)
+
 2005-06-19  Matthias Clasen  <mclasen@redhat.com>
        
        * gtk/gtk.symbols: Add a forgotten symbol
index d521ecbb876c996561c38d631d3fea75c899e00b..ef30e5e7b422453e8779cd64416d70c252b175a0 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk.symbols:
+       * gtk/gtkwindow.h:
+       * gtk/gtkwindow.c (gtk_window_present_with_time): Variant of
+       gtk_window_present which takes a timestamp.  (#166379, Elijah Newren)
+
 2005-06-19  Matthias Clasen  <mclasen@redhat.com>
        
        * gtk/gtk.symbols: Add a forgotten symbol
index d521ecbb876c996561c38d631d3fea75c899e00b..ef30e5e7b422453e8779cd64416d70c252b175a0 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk.symbols:
+       * gtk/gtkwindow.h:
+       * gtk/gtkwindow.c (gtk_window_present_with_time): Variant of
+       gtk_window_present which takes a timestamp.  (#166379, Elijah Newren)
+
 2005-06-19  Matthias Clasen  <mclasen@redhat.com>
        
        * gtk/gtk.symbols: Add a forgotten symbol
index 76396a0080d85399973b2513fadaf288f2439fed..445079696da7a5cf3ab3c7011e971725823419b7 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk-sections.txt: Add gtk_window_present_with_time
+
 2005-06-19  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/Makefile.am: Ignore some more headers.
index 758ebc94743dd08f184e21598fee29808ca35727..7ebb8d8cee1652a87d0667c68ca5cdf0d1d9c344 100644 (file)
@@ -4713,6 +4713,7 @@ gtk_window_get_focus
 gtk_window_set_focus
 gtk_window_set_default
 gtk_window_present
+gtk_window_present_with_time
 gtk_window_iconify
 gtk_window_deiconify
 gtk_window_stick
index 1709218bb08bdfef9547aae5c36bda65d418536a..ba9b06356f2c74e68241500997bdd8769fcdbc03 100644 (file)
@@ -3935,6 +3935,7 @@ gtk_window_move
 gtk_window_new
 gtk_window_parse_geometry
 gtk_window_present
+gtk_window_present_with_time
 gtk_window_propagate_key_event
 gtk_window_remove_accel_group
 gtk_window_remove_embedded_xid
index 5f7f4f499f801450838da192c3a722879834a84d..47f560180566eb6660d186818cda5381b7aa7359 100644 (file)
@@ -5999,10 +5999,42 @@ gtk_window_set_frame_dimensions (GtkWindow *window,
  * currently open, and the user chooses Preferences from the menu
  * a second time; use gtk_window_present() to move the already-open dialog
  * where the user can see it.
+ *
+ * If you are calling this function in response to a user interaction,
+ * it is preferable to use gdk_window_present_with_time().
  * 
  **/
 void
 gtk_window_present (GtkWindow *window)
+{
+  guint32 timestamp;
+#ifdef GDK_WINDOWING_X11
+  GdkDisplay *display;
+
+  display = gtk_widget_get_display (GTK_WIDGET (window));
+  timestamp = gdk_x11_display_get_user_time (display);
+#else
+  timestamp = gtk_get_current_event_time ();
+#endif
+  
+  gtk_window_present_with_time (window, timestamp);
+}
+
+/**
+ * gtk_window_present_with_time:
+ * @window: a #GtkWindow
+ * @timestamp: the timestamp of the user interaction (typically a 
+ *   button or key press event) which triggered this call
+ *
+ * Presents a window to the user in response to a user interaction.
+ * If you need to present a window without a timestamp, use 
+ * gtk_window_present(). See gtk_window_present() for details. 
+ * 
+ * Since: 2.8
+ **/
+void
+gtk_window_present_with_time (GtkWindow *window,
+                             guint32    timestamp)
 {
   GtkWidget *widget;
 
@@ -6019,13 +6051,7 @@ gtk_window_present (GtkWindow *window)
       /* note that gdk_window_focus() will also move the window to
        * the current desktop, for WM spec compliant window managers.
        */
-#ifdef GDK_WINDOWING_X11
-      gdk_window_focus (widget->window,
-                       gdk_x11_display_get_user_time (gtk_widget_get_display (widget)));
-#else
-      gdk_window_focus (widget->window,
-                        gtk_get_current_event_time ());
-#endif
+      gdk_window_focus (widget->window, timestamp);
     }
   else
     {
index 5c4e4a8d7ad2a1fe83e7ced308912786a5c72fa0..a9871e59bf18f94546e3659b34e42205eeecc2cc 100644 (file)
@@ -304,7 +304,9 @@ gboolean gtk_window_activate_key          (GtkWindow        *window,
 gboolean gtk_window_propagate_key_event   (GtkWindow        *window,
                                           GdkEventKey      *event);
 
-void     gtk_window_present       (GtkWindow *window);
+void     gtk_window_present            (GtkWindow *window);
+void     gtk_window_present_with_time  (GtkWindow *window,
+                                       guint32    timestamp);
 void     gtk_window_iconify       (GtkWindow *window);
 void     gtk_window_deiconify     (GtkWindow *window);
 void     gtk_window_stick         (GtkWindow *window);